package admincow.servlet.regevabe;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import admincow.dao.RegevabeDAO;

/**
 * Servlet implementation class for Servlet: RegevabeEliminarServlet
 *
 */
 public class RegevabeEliminarServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {
   static final long serialVersionUID = 1L;
   
    /* (non-Java-doc)
	 * @see javax.servlet.http.HttpServlet#HttpServlet()
	 */
	public RegevabeEliminarServlet() {
		super();
	}   	
	
	/* (non-Java-doc)
	 * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String x = request.getParameter("becerro");
		String y = request.getParameter("vaca");
	
	if(x!=null){
		RegevabeDAO dao = new RegevabeDAO();
		dao.eliminarb(x);
	}
	if(y!=null){
		RegevabeDAO dao = new RegevabeDAO();
		dao.eliminarv(y);
	}
		
		
		RequestDispatcher rd = request
				.getRequestDispatcher("/regevabeBuscar.jsp");
		rd.forward(request, response);
	}  	
	

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	}   	  	    
}